package com.source.pekko;

import lombok.val;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.actor.Props;

public class Demo {
    public static void main(String[] args) {
        /**创建actorSystem*/
        ActorSystem actorSystem = ActorSystem.create("flink");
        /**构建PekkoRpcActor的ActorRef*/
        ActorRef pekkoRpcRef = actorSystem.actorOf(Props.create(PekkoRpcActor.class), "PekkoReceive");
        /**构建PekkoRpcSenderActor的ActorRef*/
        ActorRef pekkoRpcSenderRef = actorSystem.actorOf(Props.create(PekkoRpcSenderActor.class), "PekkoRpcSenderActor");
        /** pekkoRpcSenderActor作为发送者 向PekkoRpcActor发送 hello*/
        pekkoRpcRef.tell(new PekkoData("hello"),pekkoRpcSenderRef);
    }
}
